function [ c, cm, pcm, ind, pr ] = cconfusion( Y, Ypr )
    
    N = size(Y,1);
    X = reshape(int32(1:N),N,1);
    Y = reshape(int32(Y),N,1);
    Ypr = reshape(int32(Ypr),N,1);
    C = size(unique(Y),1);
    
    T = zeros(N,C);
    Tpr = zeros(N,C);
    I = sub2ind(size(T),X,Y);
    T(I) = 1;
    I = sub2ind(size(T),X,Ypr);
    Tpr(I) = 1;
    [ c, cm, ind, pr ] = confusion(T',Tpr');
    pcm = cm ./ (sum(cm,2)*ones(1,C));
end

